package com.test;

import cn.jpush.api.JPushClient;
import cn.jpush.api.push.model.Platform;
import cn.jpush.api.push.model.PushPayload;
import cn.jpush.api.push.model.audience.Audience;
import cn.jpush.api.push.model.notification.AndroidNotification;
import cn.jpush.api.push.model.notification.Notification;

public class JpushDemo01 {
    public static void main(String[] args) throws Exception {
        //构建推送客户端
        JPushClient jPushClient = new JPushClient("0fea2d27d800930a11b10610", "6aca5acdfb171a73ae4c5225");

        //组装推送对象
        PushPayload payload = PushPayload.newBuilder()
                .setPlatform(Platform.all())
                .setAudience(Audience.alias("15534345943"))
                .setNotification(Notification.newBuilder().addPlatformNotification(
                        AndroidNotification.newBuilder().setTitle("申请加入").setAlert("坏次奥 申请加入企业,请审批").build()).build())
                .build();

        //推送消息
        jPushClient.sendPush(payload);

    }
}
